@@ -5,12 +5,15 @@ import com.utlis.MyBatisUtlis;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

import static com.utlis.MyBatisUtlis.getSession;

public class CustomerTest {
    @Test
    public void findCustomerByNameAndJobsTest() {
        SqlSession sqlSession = MyBatisUtlis.getSession();
        SqlSession sqlSession = getSession();
        Customer customer = new Customer();
//        customer.setUsername("jack");
//        customer.setJobs("teacher");
        @@ -23,7 +26,7 @@ public class CustomerTest {
        }
        @Test
        public void updateCustomerByTest() {
            SqlSession sqlSession = MyBatisUtlis.getSession();
            SqlSession sqlSession = getSession();
            Customer customer = new Customer();
            customer.setId(3);
            customer.setPhone("13311111134");
            @@ -37,4 +40,26 @@ public class CustomerTest {
        sqlSession.commit();
        sqlSession.close();
            }
        }
        @Test
        public void findByArrayTest() {
            SqlSession sqlSession = MyBatisUtlis.getSession();
            Integer[] roleIds = {2, 3};
            List<Customer> customers = sqlSession.selectList("findByArray", roleIds);
            for (Customer c : customers) {
                System.out.println(c);
            }
            sqlSession.close();
        }
        @Test
        public void findByListTest() {
            SqlSession sqlSession = MyBatisUtlis.getSession();
            List<Integer> ids = new ArrayList<Integer>();
            ids.add(1);
            ids.add(3);
            List<Customer> customers = sqlSession.selectList("findByList", ids);
            for (Customer c : customers) {
                System.out.println(c);
            }
            sqlSession.close();
        }
    }